package net.zjitc.hashset;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;

/**
 * @Author admin
 * @Date 2019/4/2 17:06
 */
public class HashSetTest2 {
    public static void main(String[] args) {
        HashSet<Integer> hashSet=new HashSet<Integer>();
        Random randomr=new Random();
        while (hashSet.size()<10){
            int c=randomr.nextInt(40)+1;
            hashSet.add(c);
        }
        System.out.println();
        Iterator iterator=hashSet.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next()+"\t");
        }
    }
}
